<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BannerSelectEditor.ascx.cs" Inherits="Webparts_Banner_BannerSelectEditor" %>
<DIV class=drop_down_normal onmouseover=" this.className = 'drop_down_over'; " 
     onclick= startShow();  onmouseout=" this.className = 'drop_down_normal'; ">
    <TABLE id=Table1 width="100%">
        <TBODY>
            <TR>
                <TD>
                    <DIV id=dd_title></DIV></TD>
                <TD class=drop_down_arrow onmouseover=" this.className = 'drop_down_arrow_hover'; " 
                    onmouseout=" this.className = 'drop_down_arrow'; "></TD></TR></TBODY></TABLE></DIV>

<DIV class="dd_panel_normal" id="dd_panel">

    <asp:Repeater id="rptList" runat="server">
        <HeaderTemplate>
            <table width="99%">
            <tr>
                <td class='dd_list_header' width="200px">Title</td>
                <td class='dd_list_header' width="400px">Image/Flash</td>
            </tr>
        </HeaderTemplate>
        <FooterTemplate>
        </table>
        </FooterTemplate>
        <ItemTemplate>
            <tr onmouseover=" this.className = 'dd_item_over'; " onmouseout=" this.className = 'dd_item_out'; "  
                onclick=" setSelected(<%#DataBinder.Eval(Container.DataItem, "ID")%>,'<%#DataBinder.Eval(Container.DataItem, "Name")%>')">
                <td>
                    <asp:Label ID="ID" Runat="server" Visible="False">
                        <%#DataBinder.Eval(Container.DataItem, "ID")%>
                    </asp:Label>
                    <div class="banner_title">
                        <%#DataBinder.Eval(Container.DataItem, "Name")%>
                    </div>
                </td>
                <td>
                    <div class="banner_display">
                        <%#DataBinder.Eval(Container.DataItem, "Display")%>
                    </div>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater></DIV><INPUT id=selectedIndex type=hidden value=0 name=selectedIndex>
                         <SCRIPT type="text/javascript">

var pn = null;
var dd_close = null;

function startShow() {
    pn = document.getElementById("dd_panel");
    pn.onmouseover = clearTimer;
    pn.className = "dd_panel_active";
    document.onmousedown = closingShow;
    var tags = pn.getElementsByTagName("tr");

    for (var i = 0; i < tags.length; i++) {
        tags[i].className = "dd_item_out";
    }
}

function clearTimer() {
    window.clearTimeout(dd_close);
}

function closingShow() {
    dd_close = window.setTimeout("clearShow()", 1000);
}

function clearShow() {
    pn.className = "dd_panel_normal";
}

function setSelected(id, title) {
    var bn = document.getElementById("dd_title");
    bn.innerHTML = title;
    var s = document.getElementById("selectedIndex");
    s.value = id;
    clearShow();
}

</SCRIPT>